package test2;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-03-19
 * Time: 23:17
 */

class Student{
    private String name;
    private int age;
    public String sex;

    public Student() {
    }

    public Student(String name, int age, String sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public void doClass(){
        System.out.println("上课");
    }

    private void doHomeWork(){
        System.out.println("写作业");
    }
}
public class Test {
    public static void main(String[] args) {
        Student student = new Student();
        student.sex = "男";//可以
        student.age = 10;//不行
    }
}
